<%@ page contentType="text/html; charset=utf-8" %>

<%@ include file="/WEB-INF/jsp/includeTop.jsp" %>

<script type="text/javascript" src="<c:url value='/plan/plan.js' />"></script>
<script type="text/javascript" src="<c:url value='/js/new_planjob.js' />"></script>

<table width="100%" border="0" cellpadding="0" cellspacing="5">
  <tr>
    <td valign="top">
      <table class="dbborder" width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td valign="bottom" class="blueTableBg">&nbsp;我的计划任务&nbsp;-&nbsp;新增工作计划</td>
        </tr>
        <tr>
          <td>
            <table width="100%" border="0" cellpadding="0" cellspacing="5">
              <tr>
                <td>
                  <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td class="dashTopLeft"><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                      <td class="dashTop" width=100%><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                      <td class="dashTopRight"><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                    </tr>
                    <tr>
                      <td class="dashLeft"><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                      <td align="center">
                      <form id="planForm" method="post">
                        <table width="100%" border="0" cellpadding="0" cellspacing="3">
                          
                          <tr>
                            <td width="114" height="20" class="globalText">计划名称</td>
                            <td height="20" class="globalText">
                            	<input type="text" id="planName" class="txtbox required" size="20"  value=""/>
                            </td>
                          </tr>
                          <tr>
                            <td width="114" height="20" class="globalText">计划日期</td>
                            <td height="20" class="globalText">
                            	<input onclick="WdatePicker({minDate:'${nowDate}',dateFmt:'yyyy-MM-dd'});" type="text" id="planDate" class="txtbox required" size="20"  value=""/>
                            </td>
                          </tr>
                          <tr>
                            <td width="114" height="20" class="globalText">项目及任务信息</td>
                            <td height="20" class="globalText">
                            	<input type="button" class=" btnStyle" value="+添加项目" onclick="javascript:addProject()" />
                            </td>
                          </tr>
                          <tr>
                            <td colspan="2">
                            	<table id="mainTable" width="100%" border="0" cellpadding="0" cellspacing="3">
                            	</table>
                            </td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                          </tr>
                          <tr>
                            <td align="center" colspan="2">
                              <table border="0" cellpadding="0" cellspacing="2">
                                <tr>
                                  <td><input type="button" class="btnStyle" value="  保存  " onclick="javascript:submitCreatePlan();"></td>
                                  <td>
<!--                                   <input type="button" class="btnStyle" value="  取消  " onclick="javascript:;"> -->
                                  </td>
                                </tr>
                              </table>
                            </td>
                          </tr>
                        </table>
                         </form>
                      </td>
                      <td class="dashRight"><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                    </tr>
                    <tr>
                      <td class="dashBottomLeft"><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                      <td class="dashBottom" width=100%><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                      <td class="dashBottomRight"><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>

<input type="hidden" value="${user.employee.empId}" id="empId" />

<div style="display:none;">
		<table>
								  <tr id="projectTr">
		                          	<td colspan="2">
		                          		<table class="dbborder" width="100%" border="0" cellpadding="0" cellspacing="1">
								         <tr class="rowHead">
								           <td colspan="5" width="50%" height="20" nowrap align="center" class="globalTextBold">
								           		项目
								           		<input projectIndex="" readonly="readonly" class="dynamic required" id="project_name_" type="text" onclick="javascript:chooseProject(this.getAttribute('projectIndex'));" />
								           		<input projectIndex="" projectId="" class="dynamic btnStyle" type="button" value="选择项目" onclick="javascript:chooseProject(this.getAttribute('projectIndex'));" />
								           </td>
								           <td colspan="5" width="40%" height="20" nowrap align="center" class="globalTextBold">
								           </td>
								           <td colspan="1" width="10%" height="20" nowrap align="center" class="globalTextBold">
								           		<input projectIndex="" class="dynamic btnStyle"  value="+添加任务" type="button" onclick="addTask(this.getAttribute('projectIndex'))" />
								           </td>
								         </tr>
								         <tbody id="task_list_">
								         	
								         </tbody>
								       </table>
		                          	</td>
		                          </tr>
		                          
		                          <tr id="spacingTr">
		                          	<td colspan="2">
		                          		&nbsp;
		                          	</td>
		                          </tr>


									<tr class="dynamic_task" id="taskTr" class="rowEven">
							         	<td class="taskNum dynamic globalText" taskIndex="" projectIndex="" height="20">
										</td>
							         	<td height="20" class="globalText">
							         		<input id="task_name_"  style="width: 115px;" jobId="" type="text" taskIndex="" projectIndex="" class="dynamic required" onclick="chooseTask(this.getAttribute('taskIndex'),this.getAttribute('projectIndex'));"/>
										</td>
<!-- 							         	<td height="20" class="globalText"> -->
<!-- 							         		<input taskIndex="" class="dynamic btnStyle" value="选择" type="button" onclick="chooseTask(this.getAttribute('taskIndex'));" /> -->
<!-- 							         	</td> -->
							         	<td height="20" class="globalText">
							         		终端
							         	</td>
							         	<td height="20" class="globalText">
							         		<input id="terminal_info_" style="width: 145px;" channelCode="" channelAddress="" projectIndex="" type="text" taskIndex="" class="dynamic required" onclick="chooseChannel(this.getAttribute('taskIndex'),this.getAttribute('projectIndex'));"/>
							         		<a class="dynamic" taskIndex="" id="memoTip_" href="javascript:;"><font style="color: red;">备忘</font></a>
							         	</td>
<!-- 							         	<td height="20" class="globalText"> -->
<!-- 							         		<input taskIndex="" projectIndex="" class="dynamic btnStyle" value="选择" type="button" onclick="chooseChannel(this.getAttribute('taskIndex'),this.getAttribute('projectIndex'));" /> -->
<!-- 							         	</td> -->
							         	<td height="20" class="globalText">
							         		开始时间
							         	</td>
							         	<td height="20" class="globalText">
							         		<input class="required" id="startTime"  style="width: 65px;" type="text" />
							         	</td>
							         	<td height="20" class="globalText">
							         		截止时间
							         	</td>
							         	<td height="20" class="globalText">
							         		<input class="required" id="endTime" style="width: 65px;" type="text" />
							         	</td>
		
<sec:accesscontrollist hasPermission="${P_ADMIN_STR}" secureId="${MODULE_MYPLAN_CO_STOREVISITING_CODE}" secureType="${MODULE_MYPLAN_CO_STOREVISITING_TYPE}">
							         	<td height="20" class="globalText">
							         		协同巡店人
							         		<input taskIndex="" projectIndex="" class="dynamic"  type="text" style="width: 60px;" id="cooperateUser"  />
							         	</td>
</sec:accesscontrollist>
							         	<td height="20" class="globalText">
							         		<input projectIndex="" class="dynamic btnStyle" taskIndex="" onclick="javascript:delTask(this)"  type="button" class="" value="删  除" onclick="javascript:doSubmit()">
							         	</td>
							         </tr>
							         
	</table>
</div>




<script>
	$().ready(function() {
		var validate=$("#planForm").validate({
			showErrors: customShowErrors,
			onfocusout:false,
			onkeyup:false,
			onclick:false
		});
	});
	
	var employeeUser=${employeeMap};
	
</script>


